home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / lib / Makefile < prev    next >
Makefile  |  1990-05-20  |  4KB  |  153 lines

  1. # $Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/lib/RCS/Makefile,v 3.0 90/05/20 21:03:20 kgorlen Rel $
  2. # C++ compiler
  3. CC = CC
  4.  
  5. # C++ debug switch
  6. CCDEBUG =
  7. #CCDEBUG = -g
  8.  
  9. # C++ flags
  10. # NOTE: Disable +p option when compiling with AT&T R2.1
  11. CCFLAGS = +p
  12. #CCFLAGS =
  13.  
  14. # C++ include files
  15. I = /usr/include/CC
  16.  
  17. # If using BSD
  18. SYS = BSD
  19. # If using System V
  20. #SYS = SYSV
  21.  
  22. # Compile with nested types (works with AT&T R2.1 and GNU C++)
  23. NESTED_TYPES =
  24. #NESTED_TYPES = -DNESTED_TYPES
  25.  
  26. # Disable AT&T R2.0/R2.1 bug work-around code
  27. BUGDEFS =
  28. #BUGDEFS = -DBUG_bC2728 -DBUG_38 -DBUG_39 -DBUG_OPTYPECONST
  29. # Defining BUG_TOOBIG disables code that prevents C compiler "yacc stack overflows"
  30. #BUGDEFS = -DBUG_bC2728 -DBUG_38 -DBUG_39 -DBUG_OPTYPECONST -DBUG_TOOBIG
  31.  
  32. # Enable debug code
  33. DEBUGDEFS =
  34. #DEBUGDEFS = -DDEBUG_OBJIO -DDEBUG_PROCESS
  35.  
  36. # Flags for ln
  37. #LNFLAGS =
  38. LNFLAGS = -s
  39.  
  40. # If using "patch"
  41. MAIN = _main.c_p
  42. # If using "munch"
  43. #MAIN = _main.c_m
  44.  
  45. # For no multiple inheritance support
  46. MI =
  47. # Enable support for multiple inheritance
  48. #MI = -DMI
  49.  
  50. NIHCLLIB = libnihcl.a
  51.  
  52. CFLAGS = ${MI} ${CCDEBUG} ${CCFLAGS} ${NESTED_TYPES} ${BUGDEFS} ${DEBUGDEFS}
  53.  
  54. # Target Directories
  55. NIHCLLIBDIR = /usr/lib
  56. NIHCLINCDIR = /usr/include/nihcl
  57. ERRGENDIR = /usr/local/bin
  58. ERRTABDIR = /usr/local/lib
  59.  
  60. include make.all
  61.  
  62. .SUFFIXES: ..c .s
  63. .c.a:
  64.     echo $< >>targetlist
  65. .c..c:
  66.     ${CC} ${CFLAGS} +i -c $<
  67. .c.s:
  68.     ${CC} ${CFLAGS} +i -S $<
  69.  
  70. .PRECIOUS: ${NIHCLLIB}
  71.  
  72. all: always nihclerrsx.h ${NIHCLLIB}(regex.o) ${NIHCLLIB}
  73.  
  74. always:
  75.     -rm -f targetlist *.o _main.c
  76.     touch targetlist
  77.     ${MAKE} generic _main.c
  78.  
  79. nihclerrsx.h: nihclerrs.err
  80.     if test -f /usr/bin/errcom ; then errcom nihclerrs.err ; else ${ERRGENDIR}/errgen -R${ERRTABDIR} nihclerrs.err; fi
  81.     sed -f nihclerrs.sed <nihclerrs.c >nihclerrs.tmp
  82.     mv nihclerrs.tmp nihclerrs.c
  83.     sed -n -e "s/^\([A-Z][a-zA-Z]*\).*/int NIHCL_\1    = NIHCL__\1;/p" <nihclerrs.err >nihclerrsx.h
  84.  
  85. generic: Arraychar.h Arraychar.c
  86.  
  87. _main.c:
  88.     ln ${LNFLAGS} ${MAIN} _main.c
  89.  
  90. Arraychar.h: Array_h.m4
  91.     -chmod u+w $@; rm -f $@
  92.     echo "ARRAYDECLARE(Arraychar,char)" | m4 Array_h.m4 - >Arraychar.h
  93.     chmod a-w $@
  94.  
  95. Arraychar.c: Array_c.m4 Arraychar.p
  96.     -chmod u+w $@; rm -f $@
  97.     m4 Array_c.m4 Arraychar.p >Arraychar.c
  98.     chmod a-w $@
  99.  
  100. ${NIHCLLIB}(regex.o): regex/regex.c regex.h
  101. #    cc -O -I. -D'SIGN_EXTEND_CHAR(c)=(((c) & 0x80) ? ((c) | 0xffffff80) : (c))' -c regex/regex.c
  102.     cc -O -I. -c regex/regex.c
  103.     touch targetlist
  104.  
  105. # Hack to make stdarg work on sparc
  106.  
  107. Class.o ${NIHCLLIB}(Class.o): Class.c
  108. #    ${CC} ${CFLAGS} -F -c Class.c | sed -e 's/__0__builtin/__builtin/g' >Class..c
  109.     ${CC} ${MI} ${CCFLAGS} ${NESTED_TYPES} ${BUGDEFS} ${DEBUGDEFS} -F -c Class.c | sed -e 's/__0__builtin/__builtin/g' >Class..c
  110.     cc ${CCDEBUG} -c -o Class.o Class..c
  111.     rm Class..c
  112.  
  113. Exception.o ${NIHCLLIB}(Exception.o): Exception.c
  114. #    ${CC} ${CFLAGS} -F -c Exception.c | sed -e 's/__0__builtin/__builtin/g' >Exception..c
  115.     ${CC} ${MI} ${CCFLAGS} ${NESTED_TYPES} ${BUGDEFS} ${DEBUGDEFS} -F -c Exception.c | sed -e 's/__0__builtin/__builtin/g' >Exception..c
  116.     cc ${CCDEBUG} -c -o Exception.o Exception..c
  117.     rm Exception..c
  118.  
  119. ${NIHCLLIB}: ${OBJECTS} targetlist
  120.     if test -s targetlist ; then ${CC} ${CFLAGS} -c `cat targetlist`; fi
  121.     for f in *.o; \
  122.     do \
  123.         if test '*.o' != $$f ;then \
  124.             ar rv $@ *.o; \
  125.             rm -f *.o; \
  126.             if test ${SYS} = BSD ; then ranlib ${NIHCLLIB}; fi; \
  127.         fi; \
  128.         break; \
  129.     done
  130.  
  131. install:
  132.     cp lib*.a ${NIHCLLIBDIR}
  133.     if test ${SYS} = BSD ; then \
  134.         for i in lib*.a; do (cd ${NIHCLLIBDIR}; ranlib -t $$i); done; \
  135.     fi
  136.     -mkdir ${NIHCLINCDIR}
  137.     -chmod u+w ${NIHCLINCDIR}/*.h ${NIHCLINCDIR}/Template_[ch]
  138.     -rm -f ${NIHCLINCDIR}/*.h ${NIHCLINCDIR}/Template_[ch]
  139.     cp *.h Template_[ch] ${NIHCLINCDIR}
  140.  
  141. depend:    nihclerrsx.h generic _main.c
  142.     -rm -f *..c
  143.     echo 'OBJECTS = $${NIHCLLIB}(regex.o)' *.c | sed -e 's#\([a-zA-Z0-9_]*\)\.c#$${NIHCLLIB}(\1.o)#g' >make.all
  144.     touch make.tdep
  145.     makedepend -I$I -f make.tdep -- ${CFLAGS} -- *.c
  146.     sed -e 's# $I/[^     $$]*##g' make.tdep | sed -e 's# /usr/include/[^  $$]*##g' | sed -e '/:[  ]*$$/d' | tee MAKE.dep | sed -e 's#\([a-zA-Z0-9_]*\.o\)#$${NIHCLLIB}(\1)#g' >make.dep
  147.     rm make.tdep
  148.  
  149. clean:
  150.     -rm -f targetlist *.o *..c ${NIHCLLIB} nihclerrsx.h ${GENERICS} _main.c make.tdep*
  151.  
  152. include make.dep
  153.